import { Ref } from "vue";

export const checkFormData = async (formInstance:Ref<any>) => {
  return new Promise<Boolean>((_resolve, reject) => {
    if (formInstance.value) {
      formInstance.value?.validate((errors) => {
        if (errors) {
          reject();
        } else {
          _resolve(true);
        }
      });
    } else {
      reject();
    }
  });

};
